package com.chen.music.util;

import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description 通用结果集工具类
 * @Author zgyh2
 * @Date 2022/1/14 10:31
 * @Version 1.0
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class CommonResult {

    @ApiModelProperty(value = "响应码")
    private Integer code;

    @ApiModelProperty(value = "响应标识")
    private Boolean flag;

    @ApiModelProperty(value = "响应消息")
    private String message;

    @ApiModelProperty(value = "数据")
    private Object data;

    public CommonResult(Integer code, Boolean flag) {
        this.code = code;
        this.flag = flag;
    }

    public CommonResult(Integer code, Boolean flag, String message) {
        this.code = code;
        this.flag = flag;
        this.message = message;
    }

    public CommonResult(Integer code, Boolean flag, Object data) {
        this.code = code;
        this.flag = flag;
        this.data = data;
    }
}
